# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=libharu
pkgver=2.3.0
pkgrel=1
pkgdesc="C library for generating PDF documents"
url="https://github.com/libharu/libharu"
arch="all"
license="custom"
depends=""
depends_dev="libpng-dev"
makedepends="$depends_dev automake autoconf libtool"
install=""
subpackages="$pkgname-dev $pkgname-doc"
source="https://github.com/libharu/libharu/archive/RELEASE_${pkgver//./_}.tar.gz"
builddir="$srcdir"/$pkgname-RELEASE_${pkgver//./_}

prepare() {
	cd "$builddir"
	touch include/config.h.in
	aclocal
	libtoolize
	automake --add-missing
	autoconf
}

build() {
	cd "$builddir"
	./configure --prefix=/usr
	make || return 1
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir/" install
	install -d "$pkgdir/usr/share/licenses/$pkgname"
	sed -n '102,120p' README > "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

sha512sums="ebcabf1e8488e21185a231e97b4c16f9de742ae0ac2ebc7535b72b6b8e2045c2619bc6a94a820f7f923b0dfeceb217408f4e4c613ef3602104373cdf000d3f41  RELEASE_2_3_0.tar.gz"
